package my.georings.service;

public class Adjusting {
	
	public static final int METRES_ADJUST = 300;
	public static final int UPDATE_ADJUST = 60*1000; // 1min
	
	private boolean isAdjusting = false;
	
	// return true when starts or ends adjusting
	public boolean adjustFromDistance(float distance){

		if(distance <= METRES_ADJUST && isAdjusting){
			return false;
		}else if(distance <= METRES_ADJUST && !isAdjusting){
			isAdjusting = true;
			return true;
		}else if(isAdjusting){
			isAdjusting = false;
			return true;
		}
		return false;
	}

	public boolean isAdjusting() {
		return isAdjusting;
	}

	public void setAdjusting(boolean isAdjusting) {
		this.isAdjusting = isAdjusting;
	}
	
	
}
